import {
  createRouter,
  createWebHashHistory,
  type RouteRecordRaw,
} from "vue-router";
import type { App } from "vue";
import Home from "../views/reg.vue";
const routes: RouteRecordRaw[] = [
  {
    path: "/",

    redirect: "/login",
  },
  {
    path: "/login",
    component: () => import("../views/login.vue"),
  },
  {
    path: "/reg",
    component: () => import("../views/reg.vue"),
  },
  {
    path: "/404",
    component: () => import("../views/404.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export function setupRouter(app: App<Element>) {
  app.use(router);
}
